import 'package:flutter/widgets.dart';
import 'package:flutter_dva/flutter_dva.dart';
import 'package:flutter_hooks/flutter_hooks.dart' hide Store;

Props useDvaProps({String? namespace}) {
  return use(
    _DvaPropsHook(
      namespace: namespace
    ),
  );
}

class _DvaPropsHook extends Hook<Props> {
  final String? namespace;

  const _DvaPropsHook({ this.namespace });

  @override
  _DvaPropsHookState createState() =>_DvaPropsHookState();
}

class _DvaPropsHookState extends HookState<Props, _DvaPropsHook> {
  late Props props;

  @override
  void initHook() {
    props = Props(namespace: hook.namespace);
    super.initHook();
  }

  @override
  Props build(BuildContext context) {
    return props;
  }
}


